//
// Created by 86176 on 2021/11/27.
//

#ifndef CHENYUENEW_PROTOCOLCODECFACTORY_H
#define CHENYUENEW_PROTOCOLCODECFACTORY_H


#include "FilterChain.h"

class ProtocolCodecFactory : public FilterChain{ ;
    bool getMessage(Session *pSession, IoBuffer *ioBuffer, Message *pMessage) override;
    virtual bool doDeCode(Session *pSession, IoBuffer *ioBuffer, Message *pMessage);
    virtual Message* deCode(Session *pSession, IoBuffer *ioBuffer) = 0;
    virtual bool doEnCode(Session *pSession, IoBuffer *ioBuffer, Message *pMessage);
    virtual Message* enCode(Session *pSession, IoBuffer *ioBuffer) = 0;

protected:
    ProtocolCodecFactory(const std::string& str): FilterChain(str){}
};


#endif //CHENYUENEW_PROTOCOLCODECFACTORY_H
